import { Component, Injector, Inject, Optional, OpaqueToken, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AppComponentBase } from '@shared/app-component-base';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { TabsetComponent } from 'ngx-bootstrap';
import * as moment from 'moment';
import {
  API_BASE_URL,
  PagedResultDtoOfAgentOutDto,
  AgentServiceProxy,
  EntityDto
} from '@shared/service-proxies/service-proxies';
import { AppConsts } from '@shared/AppConsts';
import { AgentAddComponent } from '../agent-add/agent-add.component';
import { AgentNoconfirmedListComponent } from '../agent-noconfirmed-list/agent-noconfirmed-list.component'
import { AgentConfirmedListComponent } from '../agent-confirmed-list/agent-confirmed-list.component';
@Component({
  selector: 'app-agent-list',
  templateUrl: 'agent-list.component.html',
  styleUrls: ['agent-list.component.scss'],
  animations: [appModuleAnimation()]
})
export class AgentListComponent extends AppComponentBase {
  @ViewChild('createAgentModal') createAgentModal: AgentAddComponent;
  @ViewChild('agentNoConfirmedList') agentNoConfirmedList: AgentNoconfirmedListComponent;
  constructor(
    injector: Injector,
  ) {
    super(injector);
  }

  refreshApplies(): void {
    this.agentNoConfirmedList.getAgents();
  }
  createAgent(): void {
    this.createAgentModal.show();
  }
}

